import React, { Component } from 'react';
import Child from './child';
class parent extends Component {
  state = {
    price: 11
  }
  amendPrice=(val)=>{
    this.setState({
      price:val
    })
  }
  render () {
    return (<>
      <h2>子组件往父组件传值</h2>
      <Child amendPrice={this.amendPrice} price={this.state.price}/>
    </>);
  }
}

export default parent;